package _32define;

import java.util.ArrayList;
import java.util.List;

public class Demo {
    public static void main(String[] args) {
        List<String> list=new ArrayList<>();
        list.add("zs");
        list.add("zs");
        list.add("ls");
        list.add("ww");
        list.add(null);
        System.out.println(list);
        list.add(1,"aa");
        System.out.println(list);

        List<String> list1=new ArrayList<>();
        list1.add("bb");
        System.out.println(list1);
        list1.addAll(0,list);
        System.out.println(list1);

        String removeValue=list1.remove(0);
        System.out.println(removeValue);
        System.out.println(list1);

        String oldValue=list1.set(1,"xxx");
        System.out.println(oldValue);
        System.out.println(list1);

        String value=list1.get(0);
        System.out.println(value);

        list.add(0,"zs");
        System.out.println(list);

        int startIndex=list.indexOf("zs");
        System.out.println("statIndex="+startIndex);
        int endIndex=list.lastIndexOf("zs");
        System.out.println("startIndex="+endIndex);
    }



}
